import request from '@/utils/request'

export function getAccommodationByDeptId(deptId) {
  return request({
    url: '/system/hotel/detail',
    method: 'get',
    params: { deptId: deptId }  // 注意这里是params不是data
  })
}
// 查询住宿产品列表
export function listAccommodation(query) {
  return request({
    url: '/system/accommodation/list',
    method: 'get',
    params: query
  })
}

// 查询住宿产品详细
export function getAccommodation(id) {
  return request({
    url: '/system/accommodation/' + id,
    method: 'get'
  })
}

// 新增住宿产品
export function addAccommodation(data) {
  return request({
    url: '/system/accommodation',
    method: 'post',
    data: data
  })
}

// 修改住宿产品
export function updateAccommodation(data) {
  return request({
    url: '/system/accommodation',
    method: 'put',
    data: data
  })
}

// 删除住宿产品
export function delAccommodation(id) {
  return request({
    url: '/system/accommodation/' + id,
    method: 'delete'
  })
}
